package com.service.Impl;


import com.constant.Constant;
import com.entity.Course;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mapper.CourseMapper;
import com.service.CourseService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;



@Service
public class CourseServiceImpl implements CourseService {

    @Autowired
    CourseMapper courseMapper;

    @Override
    public PageInfo<Course> findCourseAll(Integer pageNo, Integer course_type_id) {
        PageHelper.startPage(pageNo, Constant.PAGE_SIZE_COURSE);
        List<Course> courses = courseMapper.selectAllCourse(course_type_id);
        PageInfo<Course> page=new PageInfo<>(courses);
        return page;
    }

}
